      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
          

        <ul class="nav nav-tabs mytabs">
		  
		  <li  class="active"><a href="<?=site_url()?>/admin/index">管理员列表</a></li>
		  <li role="presentation"><a href="<?=site_url()?>/admin/add"><i class="fa fa-plus"></i> 添加管理员</a></li>
		 
		</ul>
          
          <div class="row">
            <div class="col-md-12">
             <!-- <div class="btn-group pull-right" id="templatemo_sort_btn">
                <button type="button" class="btn btn-default">Sort by</button>
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                  <span class="caret"></span>
                  <span class="sr-only">Toggle Dropdown</span>
                </button>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="#">First Name</a></li>
                  <li><a href="#">Last Name</a></li>
                  <li><a href="#">Username</a></li>
                </ul>
             </div>-->
              
              <div class="table-responsive">
                 
                <table class="table table-striped table-hover table-bordered">
                  <thead>
                    <tr>
                      <th>ID</th>
                      <th>用户名</th>
                      <th>姓名</th>
                      <th>手机号</th>
                      <th>类型</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                  	<?php foreach ($admins as $item):?>
                    <tr>
                      <td><?php echo $item['id'];?></td>
                      <td><?php echo $item['username'];?></td>
                      <td><?php echo $item['name'];?></td>
                      <td><?php echo $item['cellphone'];?></td>
                    <td><?php 
                      	if($item['type']==0){
                      		echo "普通管理员";
                      	}
                      	if($item['type']==1){
                      		echo "超级管理员";
                      	}
                      ?></td>
                      <td>
                      	    <a href="<?php echo site_url('admin/edit/id/'.$item['id'])?>" class=" ">编辑</a>
                      	    | <a href="#" class="del" data-id="<?php echo $item['id'];?>" >删除</a>
                      </td>
                     
                    </tr>
                     <?php endforeach;?>
                  </tbody>
                </table>
              </div>
              <!--<ul class="pagination pull-right">
                <li class="disabled"><a href="#">&laquo;</a></li>
                <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">2 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">3 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">4 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">5 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">&raquo;</a></li>
              </ul>  -->
            </div>
          </div>
        </div>
      </div>
    <script>
	$(document).ready(function() {
		$(".del").click(function() {
			if(confirm("确定要删除该管理员吗？"))
			{
			var id = $(this).attr("data-id");
			$.ajax({
				url : '<?php echo site_url('admin/delete')?>',
				type : "post",
				async : false,
				data : {
					'id' : id
				},
				dataType : "json",
				success : function(data) {
					if(data.code)
					{
						alert(data.msg);
						window.location.reload();
					}else{
						alert(data.msg);
					}
					
				}
			});
			}
		});
	}); 
</script>